/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package slent.iespana.es.visualizacion;

/**
 *Esta clase se encarga de las labores de conversion de colores
 * @author slent
 */
public class ColorJOGL {

    private double red;
    private double green;
    private double blue;

    public double getBlue() {
        return blue;
    }

    public void setBlue(double blue) {
        this.blue = blue;
    }

    public double getGreen() {
        return green;
    }

    public void setGreen(double green) {
        this.green = green;
    }

    public double getRed() {
        return red;
    }

    public void setRed(double red) {
        this.red = red;
    }


    public static ColorJOGL transformarColor(String stringColor){
        ColorJOGL color = new ColorJOGL();

//        System.out.println("parsing: "+stringColor.substring(0, 2)+" : "+
//                stringColor.substring(2, 4)+" : "+stringColor.substring(4, 6)
//        );
        color.red=(double)(Integer.parseInt(stringColor.substring(0, 2), 16))/(double)255;
        color.green=(double)(Integer.parseInt(stringColor.substring(2, 4), 16))/(double)255;
        color.blue=(double)(Integer.parseInt(stringColor.substring(4, 6), 16))/(double)255;
        return color;
    }
}
